﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DataCache.aspx.cs" Inherits="LearnJquery.DataCache" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="js/jquery-1.4.1-vsdoc.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p>one</p>
        <p id="two">two</p>
        <p>three</p>
        <p>four</p>

        <input type="button" value="Data" onclick="dataOperation()" />
    </div>
    <script type="text/javascript">
        function dataOperation() {
            var p = $("#two");
            alert(p.data("data"));

            p.data("data", "hello");
            alert(p.data("data"));

            p.removeData("data");
            alert(p.data("data"));
        }
    </script>
    </form>
</body>
</html>
